package com.example.demo.singletonMode;

/**
 * 饥饿式单例
 * 变量在声明时便初始化：类加载之后创建，并占用一块内存，增加类初始化时间
 */
public class Hunger {

    private Hunger(){
    }

    private final static Hunger HUNGER = new Hunger();

    public static Hunger getInstance(){
        return HUNGER;
    }


}
